﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Exercise15
{
    public partial class Form1 : Form
    {
        StrFun MyStrFun = new StrFun();
        User UserCtrl;
        public Form1()
        {
            InitializeComponent();
        }

        private void BtnClear_Click(object sender, EventArgs e)
        {
            TxtIn.Clear();
            TxtOut.Clear();
        }

        private void BtnGetClick(object sender, EventArgs e)
        {            
            UserCtrl = MyStrFun.GetResult(TxtIn.Text);
            if (UserCtrl.bIsNull) { TxtOut.Text = UserCtrl.StrMsg; }
            else                  { TxtOut.Text = MyStrFun.Count.ToString(); }
        }
    }
}
